#ifndef SIMULATION_CORE_MATH_H
#define SIMULATION_CORE_MATH_H

#include <vector>
#include <SimulationCore/Point.h>
namespace SimulationCore
{
    namespace SimMath
    {
        /**
         * Computes the destination point given a start point, a bearing and a distance
         * @param lat1Rad
         *    The latitude in radians
         * @param lon1Rad
         *    The longitude in radians
         * @param bearingRad
         *    The bearing in radians
         * @param distance
         *    The distance in meters
         * @param out_latRad
         *    The destination point's latitude in radians
         * @param out_lonRad
         *    The destination points' longitude in radians
         * @param radius
         *    The radius of the earth in meters
         */
        void destination(double lat1Rad, double lon1Rad,
                     double bearingRad, double distance,
                     double &out_latRad, double &out_lonRad,
                     double radius);

        /**
         * Generates a circle in 2D , south up is 0
         * @param x The x coordinate of the center of the circle
         * @param y The y coordinate of the center of the circle
         * @param radius The radius of the circle
         * @param numSegments Number of circumference segments, or zero to automatically calculate it
         */
        std::vector<SimPoint> GenerateCircle2D(double x, double y, double radius, int numSegments);

        /**
         * Generates a circle in 3D , south up is 0
         * @param x The x coordinate of the center of the circle
         * @param y The y coordinate of the center of the circle
         * @param z The z coordinate of the center of the circle
         * @param radius The radius of the circle
         * @param numSegments Number of circumference segments, or zero to automatically calculate it
         */
        std::vector<SimPoint> GenerateCircle3D(double x, double y,double z, double radius, int numSegments);


        /**
         * Generates an arc in 2D , south up is 0
         * @param x The x coordinate of the center of the arc
         * @param y The y coordinate of the center of the arc
         * @param radius The radius of the arc
         * @param startAngle The start angle of the arc
         * @param endAngle The end angle of the arc
         * @param numSegments Number of circumference segments, or zero to automatically calculate it
         * @param pie Indicates to create a pie shape rather than an arc.
         */
        std::vector<SimPoint> GenerateArc2D(double x, double y,double radius,
                                        double startAngle,double endAngle,
                                        unsigned numSegments,bool pie = false);

    }
}


#endif